<?php use_stylesheets_for_form($form) ?>
<?php use_javascripts_for_form($form) ?>

<script type="text/javascript">
    
    $(document).ready(function(){
        // Interceptamos el evento submit
        $('#form_ensayo').submit(function() {
            $('#loader').show();
            $('#ensayo').hide();
            generarArreglo(); 
        });
    });

</script>

<form id="form_ensayo" action="<?php echo url_for('ensayo/' . ($form->getObject()->isNew() ? 'create' : 'update') . (!$form->getObject()->isNew() ? '?id=' . $form->getObject()->getId() : '?hipermedio_id=' . $hipermedio->getId())) ?>" method="post" onSubmit="generarArreglo()" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
    <fieldset>
        <legend> <div class="circle">2</div> Inserta tu ensayo</legend>
        <?php if (!$form->getObject()->isNew()): ?>
            <input type="hidden" name="sf_method" value="put" />
        <?php endif; ?>
        <table id="ensayo">
            <tfoot>
                <tr>
                    <td colspan="2">
                        <?php if (!$form->getObject()->isNew()): ?>
                            &nbsp;<?php echo link_to('Delete', 'ensayo/delete?id=' . $form->getObject()->getId(), array('method' => 'delete', 'confirm' => 'Are you sure?')) ?>
                        <?php endif; ?>
                        <input type="submit" value="Guardar" />
                    </td>
                </tr>
            </tfoot>
            <tbody>
                <?php echo $form ?>
            </tbody>
        </table>
        <div id="loader" style="vertical-align: middle" alt ="loading" class="align_center hide">
            <img src="../../../images/loader.gif"/><h3>Cargando</h3>
        </div>

    </fieldset>
</form>



